package wnhz.com.business.groupshop.ui;

import android.content.Context;
import android.content.Intent;
import android.graphics.Paint;
import android.os.Build;
import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.WindowManager;
import android.widget.TextView;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;
import wnhz.com.business.R;
import wnhz.com.business.base.BaseActivity;
import wnhz.com.business.base.BaseRVAdapter;
import wnhz.com.business.base.BaseViewHolder;
import wnhz.com.business.impl.ActionBarClickListener;
import wnhz.com.business.view.TranslucentActionBar;

/**
 * 退款售后
 */
public class TuiKuanActivity extends BaseActivity implements ActionBarClickListener {

    @BindView(R.id.actionbar)
    TranslucentActionBar actionbar;
    @BindView(R.id.recycler_data)
    RecyclerView recyclerData;

    private List<String> itemdata = new ArrayList<>();

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_tui_kuan);
        ButterKnife.bind(this);

        actionbar.setData("退款/售后", R.drawable.ic_lefft_white, null, 0, null, 0, this);
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
            this.getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
            actionbar.setStatusBarHeight(getStatusBarHeight());
        }

        initview();
        setRecyclerData();

    }


    public static Intent createIntent(Context context) {
        Intent intent = new Intent(context, TuiKuanActivity.class);
        return intent;
    }

    private void initview(){

        recyclerData.setLayoutManager(new LinearLayoutManager(this,LinearLayoutManager.VERTICAL,false));
        for (int i = 0; i < 3; i++) {
                itemdata.add("acb"+i);
        }
    }


    private void  setRecyclerData()
    {
        recyclerData.setAdapter(new BaseRVAdapter(this,itemdata) {
            @Override
            public int getLayoutId(int viewType) {
                return R.layout.item_tuikuan;
            }

            @Override
            public void onBind(BaseViewHolder holder, int position) {
                //设置删除线
                TextView tv_oldprice = holder.getTextView(R.id.tv_oldprices);
                tv_oldprice.getPaint().setFlags(Paint.STRIKE_THRU_TEXT_FLAG);
            }

        });
    }


    @Override
    public void onLeftClick() {
        finish();

    }

    @Override
    public void onRightClick() {

    }

    @Override
    public void onEditTextClick() {

    }
}
